37fa77355a5b69c66bf568a9f80a8fc7d1996543,deploymentadmin/autoconf/src/test/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessorTest.java,AutoConfResourceProcessorTest,testSimpleSession,#,56

Before Change


    public void testSimpleSession() throws Exception {
        AutoConfResourceProcessor p = new AutoConfResourceProcessor();
        Utils.configureObject(p, LogService.class);
        Utils.configureObject(p, Component.class, Utils.createMockObjectAdapter(Component.class, new Object() {
            public DependencyManager getDependencyManager() {
                return new DependencyManager((BundleContext) Utils.createNullObject(BundleContext.class));
            }
        }));
        File tempDir = File.createTempFile("persistence", "dir");
        tempDir.delete();
        tempDir.mkdirs();

After Change


    public void testSimpleSession() throws Exception {
        AutoConfResourceProcessor p = new AutoConfResourceProcessor();
        Utils.configureObject(p, LogService.class);
        Utils.configureObject(p, DependencyManager.class, new DependencyManager((BundleContext) Utils.createNullObject(BundleContext.class)) {
        	public void remove(Component service) {
        	}
        });
        File tempDir = File.createTempFile("persistence", "dir");
        tempDir.delete();
        tempDir.mkdirs();
        
        System.out.println("Temporary dir: " + tempDir);
        
        Utils.configureObject(p, PersistencyManager.class, new PersistencyManager(tempDir));
        Session s = new Session();
        p.begin(s);
        Utils.configureObject(p, Component.class, Utils.createMockObjectAdapter(Component.class, new Object() {
            public DependencyManager getDependencyManager() {
                return new DependencyManager((BundleContext) Utils.createNullObject(BundleContext.class));
            }
        }));
        p.process("a", new ByteArrayInputStream("<MetaData />".getBytes()));
        p.process("b", new ByteArrayInputStream("<MetaData />".getBytes()));
        p.prepare();